package com.amt.basic.controller;

import com.amt.basic.service.OrderService;
import com.amt.configure.ControllerLog;
import com.amt.configure.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "订单相关消息订阅")
@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @ApiOperation(value = "订单服务-售后消息", notes = "售后消息")
    @ApiResponses({
            @ApiResponse(code = 0, message = "成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "失败", response = ResultMsg.class)})
    @PostMapping("ec_rights/createRights")
    @ControllerLog("售后消息新增")
    public String createRights(@RequestBody String param) {
        return orderService.createRights(param);
    }


    @ApiOperation(value = "订单服务-新增订单", notes = "新增订单")
    @ApiResponses({
            @ApiResponse(code = 0, message = "成功", response = ResultMsg.class),
            @ApiResponse(code = 1, message = "失败", response = ResultMsg.class)})
    @PostMapping("ec_order/createOrder")
    @ControllerLog("新增订单")
    public String createOrder(@RequestBody String param) {
        return orderService.createOrder(param);
    }


}
